package com.dfbz.homework6;

import org.junit.Test;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class test {
    @Test
    public void testDen() throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException {
        //获取字节码对象
        Class<Student> studentClass = Student.class;
        //获取构造器
//        Constructor<Student> constructor = studentClass.getConstructor(String.class, int.class);
//        constructor.setAccessible(true);
//        Student s1 = constructor.newInstance("王五", 20);
//        System.out.println(s1);

    }

}
